load("../refinedata/analysis/analysis_total_Fixed.rda")
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.6.3
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
analysis_total_Fixed <- analysis_total_Fixed %>% filter(substr(일시,1,7)=='2016-01'|substr(일시,1,7)=='2016-02')
analysis_total_Fixed$`최다풍향(16방위)` <- as.factor(analysis_total_Fixed$`최다풍향(16방위)`)
analysis_total <- analysis_total_Fixed %>% dplyr::select(`최다풍향(16방위)`, PM10, PM25)
## Adding missing grouping variables: `시도코드`
analysis_total <- rename(analysis_total,wind = `최다풍향(16방위)`)
fit.aov <- aov(formula = PM10 ~ wind,data = analysis_total)
summary(fit.aov)
## Df Sum Sq Mean Sq F value Pr(>F)
## wind 15 10383 692.2 2.251 0.00411 **
## Residuals 1004 308794 307.6
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Warning: package 'multcomp' was built under R version 3.6.3
## Loading required package: mvtnorm
## Loading required package: survival
## Loading required package: TH.data
## Warning: package 'TH.data' was built under R version 3.6.3
## Loading required package: MASS
##
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
##
## select
##
## Attaching package: 'TH.data'
## The following object is masked from 'package:MASS':
##
## geyser
## Call:
## aov(formula = PM10 ~ wind, data = analysis_total)
##
## Terms:
## wind Residuals
## Sum of Squares 10382.69 308794.48
## Deg. of Freedom 15 1004
##
## Residual standard error: 17.53751
## Estimated effects may be unbalanced
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps
## Warning in RET$pfunction("adjusted", ...): Completion with error > abseps

library(readr)
library(dplyr)
temp <- analysis_total_Fixed %>% dplyr::select(시도코드,`최다풍향(16방위)`)
library(data.table)
##
## Attaching package: 'data.table'
## The following objects are masked from 'package:dplyr':
##
## between, first, last
#temp <- melt(temp,id.vars=c("시도"))
#temp
library(prettyR)
temp <- rename(temp , 최다풍향=`최다풍향(16방위)` )
temp$최다풍향 <- as.factor(temp$최다풍향)
temp$시도코드 <- as.factor(temp$시도코드)
temp2 <- xtabs(data=temp,formula = ~시도코드+최다풍향 )
temp2 <- as.data.frame(temp2)
library(kormaps2014)
library(ggiraphExtra)
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.6.3
library(data.table)
library(dplyr)
tempmap <- kormap1
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp_map_join <- inner_join(tempmap,df_sido,by=c('name1'))
## Warning: Column `name1` joining factors with different levels, coercing to
## character vector
temp_map_join <- temp_map_join %>% dplyr::select(-code.x)
temp_map_join <- rename(temp_map_join,code=code.y)
temp_map_join$code <- as.character(temp_map_join$code)
temp_map_join$region <- temp_map_join$code
temp_map_join$SIDO_CD <- temp_map_join$code
ggChoropleth(data=analysis_total_Fixed,
aes(fill=PM10,
map_id=시도코드,
tooltip=시도
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
ggChoropleth(data=analysis_total_Fixed,
aes(fill=PM25,
map_id=시도코드,
tooltip=시도
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 1)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ Freq : int 2 0 0 6 19 0 6 1 3 3 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 2)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 2 2 2 2 2 2 2 2 2 2 ...
## $ Freq : int 5 7 0 1 19 0 3 2 4 1 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 3)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 3 3 3 3 3 3 3 3 3 3 ...
## $ Freq : int 1 0 0 0 1 0 0 0 1 0 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 4)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 4 4 4 4 4 4 4 4 4 4 ...
## $ Freq : int 6 0 1 3 0 0 0 0 1 1 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 5)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 5 5 5 5 5 5 5 5 5 5 ...
## $ Freq : int 3 1 11 4 0 4 2 2 2 0 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 6)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 6 6 6 6 6 6 6 6 6 6 ...
## $ Freq : int 1 1 0 0 0 1 0 0 1 0 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 7)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 7 7 7 7 7 7 7 7 7 7 ...
## $ Freq : int 1 0 0 2 1 0 0 1 0 0 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 8)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 8 8 8 8 8 8 8 8 8 8 ...
## $ Freq : int 0 0 0 3 1 0 0 0 4 1 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 9)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 9 9 9 9 9 9 9 9 9 9 ...
## $ Freq : int 0 0 0 0 0 9 0 6 1 3 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 10)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 10 10 10 10 10 10 10 10 10 10 ...
## $ Freq : int 1 1 0 0 2 0 2 0 3 4 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 11)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 11 11 11 11 11 11 11 11 11 11 ...
## $ Freq : int 0 3 3 3 9 0 5 3 0 5 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 12)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 12 12 12 12 12 12 12 12 12 12 ...
## $ Freq : int 3 14 13 4 4 0 8 9 9 27 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 13)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 13 13 13 13 13 13 13 13 13 13 ...
## $ Freq : int 3 11 29 19 1 2 7 7 25 8 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 14)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 14 14 14 14 14 14 14 14 14 14 ...
## $ Freq : int 23 2 3 5 2 26 14 15 5 5 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 15)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 15 15 15 15 15 15 15 15 15 15 ...
## $ Freq : int 10 13 0 8 0 14 11 10 0 1 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)
temp3 <- temp2 %>% filter(최다풍향 == 16)
code <- c('42','41','43','44','30','47','48','45','46','11','28','27','31','29','26','49','36')
name1 <- c('강원도','경기도','충청북도','충청남도','대전광역시','경상북도','경상남도','전라북도','전라남도','서울특별시','인천광역시','대구광역시','울산광역시','광주광역시','부산광역시','제주특별자치도','세종특별자치시')
df_sido <- data.frame("code"=code,"name1"=name1)
temp3 <- inner_join(temp3,df_sido,by=c("시도코드"="code"))
str(temp3)
## 'data.frame': 17 obs. of 4 variables:
## $ 시도코드: Factor w/ 17 levels "11","26","27",..: 1 2 3 4 5 6 7 8 9 10 ...
## $ 최다풍향: Factor w/ 16 levels "1","2","3","4",..: 16 16 16 16 16 16 16 16 16 16 ...
## $ Freq : int 1 7 0 2 1 4 2 4 1 1 ...
## $ name1 : Factor w/ 17 levels "강원도","경기도",..: 9 8 6 12 5 7 11 10 2 1 ...
str(df_sido)
## 'data.frame': 17 obs. of 2 variables:
## $ code : Factor w/ 17 levels "11","26","27",..: 10 9 11 12 6 15 16 13 14 1 ...
## $ name1: Factor w/ 17 levels "강원도","경기도",..: 1 2 17 16 7 4 3 14 13 9 ...
ggChoropleth(data=temp3,
aes(fill=Freq,
map_id=시도코드,
tooltip=name1
),
#palette = '',
map=temp_map_join,
interactive=TRUE)